package com.design.pattern.template;

public abstract class CaffeineBeverage {

    public void prepareRecipe() {
        boilWater();
        brew();
        pourInCup();
        if (customerWantsCondiments()) {
            addCondiments();
        }
    }

    abstract void brew();

    abstract void addCondiments();

    void boilWater() {
        System.out.println("煮沸开水。。。");
    }

    void pourInCup() {
        System.out.println("把饮料倒进杯子里。。。");
    }

    boolean customerWantsCondiments() {
        return true;
    }

}